﻿
namespace Inovout.Gis
{
    public abstract class LayerObject : ILayerObject, ILayerInfo
    {
        protected LayerObject()
        {
        }
        protected LayerObject(IGisTable gisTable)
            : this(LayerFactory.CreateLayer(gisTable))
        {
        }

        public string Name { get { return layerInfo.Name; } }
        private ILayerInfo layerInfo;
        protected ILayerInfo LayerInfo
        {
            get { return layerInfo; }
        }
        private IGroupLayerObject owner;
        public IGroupLayerObject Owner
        {
            get
            {
                if (owner == null)
                {
                    return owner = layerInfo.Owner as IGroupLayerObject;
                }
                return owner;
            }
            internal set { owner = value; }
        }
        IGroupLayerInfo ILayerInfo.Owner
        {
            get { return layerInfo.Owner; }
        }
        protected LayerObject(ILayerInfo layerInfo)
        {
            this.layerInfo = layerInfo;
        }



    }
}
